package cn.wolfcode.p2p.business.domain;

import cn.wolfcode.p2p.base.domain.BaseDomain;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 * 平台账户信息
 */
@Setter@Getter
public class PlatformBankInfo extends BaseDomain {
    private String bankName; //银行名称

    private String accountName; //开户人姓名

    private String accountNumber; //银行卡号

    private String bankForkName; //开户支行

    /**
     * 平台账户管理json
     *
     * @return
     */
    public String getJsonString() {
        Map<String, Object> map = new HashMap();
        map.put("id", this.id);
        map.put("accountName", this.accountName);
        map.put("bankName",this.bankName);
        map.put("accountNumber", this.accountNumber);
        map.put("bankForkName", this.bankForkName);
        try {
            return (new ObjectMapper()).writeValueAsString(map);
        } catch (JsonProcessingException var3) {
            var3.printStackTrace();
            return null;
        }
    }
}